<div class="page-header">
	<h1>Danh sách đánh giá</h1>
</div>
<?php
//set "code" for searches
echo $paging;
$url_form = !empty($page_index)?$this->config->item('admin_folder').'/comment/bulk_save/'.$page_index:$this->config->item('admin_folder').'/comment/bulk_save';
echo form_open($url_form, array('id'=>'bulk_form'));?>
	<table class="table table-striped">
		<thead>
			<tr>
				<th>ID</th>
				<th>Tên người đánh giá</th>
                <th>Số điểm</th>
				<th style="width: 34%;">Nội dung đánh giá</th>
                <th>Đánh giá sản phẩm </th>
                <th>Ngày đánh giá</th>
				<th>
					<a class="btn" style="font-weight:normal;" href="<?php echo site_url("admin/comment/form")?>"><i class="icon-plus-sign"></i> Thêm bình luận mới</a>
				</th>
			</tr>
		</thead>
		<tbody>
	<?php echo (count($model) < 1)?'<tr><td style="text-align:center;" colspan="7"> Hiện không có tin tức</td></tr>':''?>
	<?php foreach ($model as $item):if(!empty($item->info_user->fullname)){$fullname = $item->info_user->fullname;}else{$array_name = explode("@",$item->info_user->email);$fullname = $array_name[0];}?>
			<tr>
            	<td> <?php echo $item->id;?></td>
				<td><?php echo $fullname?></td>
				<td><?php echo $item->score?></td>
                <td><?php echo $item->content?></td>
                <td ><a target="_blank" href="<?php echo site_url($item->slug_pro)?>"> <?php echo $item->name_pro?> </a></td>
				<td><?php echo date("d/m/Y h:i:s",$item->created)?>	</td>
				<td>
                
					<span class="btn-group pull-right">
                    <a class="btn" href="<?php echo site_url($this->config->item('admin_folder').'/comment/form/'.$item->id."/".$page_index);?>"><i class="icon-pencil"></i> Sửa</a>
						<a class="btn btn-danger" href="<?php echo site_url($this->config->item('admin_folder').'/comment/delete/'.$item->id."/".$page_index);?>" onclick="return areyousure();"><i class="icon-trash icon-white"></i> <?php echo lang('delete');?></a>
					</span>
				</td>
			</tr>
	<?php endforeach; ?>
		</tbody>
	</table>
</form>
<script language="javascript">
	$(".btn-danger").click(function(){
		return confirm("Bạn có thật sự muốn xóa");
	});
</script>